<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="70px">

      <el-row :gutter="1">
        <el-col :span="6">
          <el-form-item label="代码" prop="stockCode">
            <el-input
                v-model="queryParams.stockCode"
                placeholder="请输入代码"
                clearable
                @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="名字" prop="stockName">
            <el-input
                v-model="queryParams.stockName"
                placeholder="请输入名字"
                clearable
                @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="涨幅" prop="raiseRange">
            <el-input
                v-model="queryParams.raiseRange"
                placeholder="请输入涨幅"
                clearable
                @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="市净率" prop="pb">
            <el-input
                v-model="queryParams.pb"
                placeholder="请输入市净率"
                clearable
                @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="量比" prop="countRate">
            <el-input
                v-model="queryParams.countRate"
                placeholder="请输入量比"
                clearable
                @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="题材" prop="countRate">
            <el-input
                v-model="queryParams.tcName"
                placeholder="请输入题材"
                clearable
                @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="集中度" prop="holdFocus">
            <el-select v-model="queryParams.holdFocus" placeholder="请选择筹码集中度" clearable>
              <el-option
                  v-for="dict in com_hold_focus"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="股东变化率" prop="holderTotalNumRatio">
            <el-input
                v-model="queryParams.holderTotalNumRatio"
                placeholder="请输入变化率"
                clearable
                @keyup.enter="handleQuery"
            />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row :gutter="6">
        <el-col :span="6">
          <el-form-item label="股东人数" prop="holderTotalNum">
            <el-row>
              <el-col :span="9">
                <el-input
                    v-model="queryParams.holderTotalNum"
                    placeholder="最小值"
                    clearable
                    @keyup.enter="handleQuery"
                />
              </el-col>
              <el-col :span="3" type="flex" class="row-bg" justify="center" align="middle">
                <!--            内容居中-->
                -
              </el-col>
              <el-col :span="9">
                <el-input
                    v-model="queryParams.holderTotalNum1"
                    placeholder="最大值"
                    clearable
                    @keyup.enter="handleQuery"
                />
              </el-col>

            </el-row>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="换手率" prop="txRate">
            <el-row>
              <el-col :span="9">
                <el-input
                    v-model="queryParams.txRate"
                    placeholder="最小值"
                    clearable
                    @keyup.enter="handleQuery"
                />
              </el-col>
              <el-col :span="3" type="flex" class="row-bg" justify="center" align="middle">
                <!--            内容居中-->
                -
              </el-col>
              <el-col :span="9">
                <el-input
                    v-model="queryParams.txRate1"
                    placeholder="最大值"
                    clearable
                    @keyup.enter="handleQuery"
                />
              </el-col>

            </el-row>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="最新价" prop="price">
            <el-row>
              <el-col :span="9">
                <el-input
                    v-model="queryParams.price"
                    placeholder="最低价"
                    clearable
                    @keyup.enter="handleQuery"
                />
              </el-col>
              <el-col :span="3" type="flex" class="row-bg" justify="center" align="middle">
                <!--            内容居中-->
                -
              </el-col>
              <el-col :span="9">
                <el-input
                    v-model="queryParams.price1"
                    placeholder="最高价"
                    clearable
                    @keyup.enter="handleQuery"
                />
              </el-col>

            </el-row>
          </el-form-item>
        </el-col>
        <!--        <el-col :span="6">-->
        <!--          <el-form-item>-->
        <!--            <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>-->
        <!--            <el-button icon="Refresh" @click="resetQuery">重置</el-button>-->
        <!--          </el-form-item>-->
        <!--        </el-col>-->
      </el-row>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
            type="primary"
            plain
            icon="Plus"
            @click="handleAdd"
            v-hasPermi="['enterprise:base:add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="success"
            plain
            icon="Edit"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['enterprise:base:edit']"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="danger"
            plain
            icon="Delete"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['enterprise:base:remove']"
        >删除
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="warning"
            plain
            icon="Download"
            @click="handleExport"
            v-hasPermi="['enterprise:base:export']"
        >导出
        </el-button>
      </el-col>
      <el-col :span="1.5">

      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
      </el-col>
      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading"
              stripe
              class="base-table"
              border
              :data="baseList"
              @selection-change="handleSelectionChange"
              :default-sort="{ prop: 'holderTotalNum', order: 'descending' }">
      <!--      <el-table-column type="selection" width="55" align="center"/>-->
      <!--      <el-table-column label="编号" align="center" prop="id"/>-->

      <el-table-column fixed label="代码" align="center" prop="stockCode"/>
      <el-table-column fixed label="名字" align="center" prop="stockName"/>
      <el-table-column label="集中度" align="center" prop="holdFocus">
        <template #default="scope">
          <dict-tag :options="com_hold_focus" :value="scope.row.holdFocus"/>
        </template>
      </el-table-column>
      <el-table-column label="最新价" align="center" sortable prop="price"/>

      <el-table-column style="font-size: 10px;" label="涨幅" align="center" sortable prop="raiseRange">
        <template #default="scope">
          <el-text tag="b" class="mx-1" size="small" :type="handleYK(scope.row.raiseRange)">{{
              scope.row.raiseRange
            }}%
          </el-text>
        </template>
      </el-table-column>
      <el-table-column label="题材详情" align="center" prop="tcDetail" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-text v-if="scope.row.tcDetail==null">-</el-text>
          <el-button v-else type="text"
                     @click="showDetailTc(scope.row.stockName+ ' - 题材详情',scope.row.tcDetail,true)">查看
            ({{ scope.row.tcCount }})
          </el-button>
        </template>
      </el-table-column>
      <el-table-column label="成交额" align="center" sortable prop="txAmount">
        <template #default="scope">
          <span>{{ tool.formatNumber(scope.row.txAmount) }}</span>
        </template>
      </el-table-column>

      <el-table-column label="成交量" align="center" sortable prop="txCount">
        <template #default="scope">
          <span>{{ tool.kcbMyformatNum(scope.row.txCount) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="换手率" align="center" sortable prop="txRate">
        <template #default="scope">
          <el-text tag="b" class="mx-1" :type="handleYK(scope.row.txRate,20)">{{
              scope.row.txRate
            }}%
          </el-text>
        </template>
      </el-table-column>
      <el-table-column label="市净率" align="center" sortable prop="pb"/>
      <el-table-column label="市盈率" align="center" sortable prop="pe">
        <template #default="scope">
          <span>{{ scope.row.pe }}</span>
        </template>
      </el-table-column>
      <el-table-column label="量比" align="center" sortable prop="countRate">
        <template #default="scope">
          <span>{{ scope.row.countRate }}</span>
        </template>
      </el-table-column>


      <!--      <el-table-column label="入选原因" align="center" show-overflow-tooltip>-->
      <!--        <template #default="scope">-->
      <!--          &lt;!&ndash;          <el-button type="text"&ndash;&gt;-->
      <!--          &lt;!&ndash;                     @click="showDetailReason(scope.row.stockName+ ' - 入选详情',scope.row.selectedBoardReason,true)">查看&ndash;&gt;-->
      <!--          &lt;!&ndash;          </el-button>&ndash;&gt;-->
      <!--          <Ellipsis :maxWidth="40">-->
      <!--            {{ scope.row.selectedBoardReason}}-->
      <!--          </Ellipsis>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
      <!--      <el-table-column label="公司类型" align="center" prop="companyType"/>-->
      <!--      <el-table-column label="公司简介" align="center" prop="companyUrl"/>-->
      <!--      <el-table-column label="沪深京A更新" align="center" prop="updateTimeHsja" width="180">-->
      <!--        <template #default="scope">-->
      <!--          <span>{{ parseTime(scope.row.updateTimeHsja, '{y}-{m}-{d}') }}</span>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
      <!--      <el-table-column label="题材更新" align="center" prop="updateTimeTc" width="180">-->
      <!--        <template #default="scope">-->
      <!--          <span>{{ parseTime(scope.row.updateTimeTc, '{y}-{m}-{d}') }}</span>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
      <!--      <el-table-column label="股东数更新" align="center" prop="updateTimeHolderCount" width="180">-->
      <!--        <template #default="scope">-->
      <!--          <span>{{ parseTime(scope.row.updateTimeHolderCount, '{y}-{m}-{d}') }}</span>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
      <!--      <el-table-column label="公司名字" align="center" prop="companyName"/>-->
      <!--      <el-table-column label="主营业务" align="center" prop="mainBusiness"/>-->
      <el-table-column label="人数" fixed align="center" sortable prop="holderTotalNum">
        <template #default="scope">
          <el-text tag="b" class="mx-1" :type="handlePeopleCount(scope.row.holderTotalNum,8000)">{{
              tool.formatNumber(scope.row.holderTotalNum)
            }}
          </el-text>
        </template>

      </el-table-column>
      <el-table-column label="股东变化率" align="center" sortable prop="holderTotalNumRatio">
        <template #default="scope">
          <el-text tag="b" class="mx-1" :type="handleYK(scope.row.holderTotalNumRatio)">{{
              scope.row.holderTotalNumRatio
            }}%
          </el-text>
        </template>
      </el-table-column>
      <el-table-column label="人均流通股数" align="center" prop="aveFreeSharesNum">
        <template #default="scope">
          <span>{{ tool.formatNumber(scope.row.aveFreeSharesNum) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="人均流通股变化率" align="center" prop="aveFreeSharesRatio"/>
      <el-table-column label="股东股价" align="center" prop="avePrice"/>
      <el-table-column label="人均金额" align="center" prop="aveHoldAmt">
        <template #default="scope">
          <span>{{ tool.formatNumber(scope.row.aveHoldAmt) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="十大股东持股合计(%)" align="center" sortable prop="holdRatioTotal"/>
      <el-table-column label="十大流通股东持股合计(%) " align="center" sortable prop="freeholdRatioTotal"/>
      <el-table-column label="更新时间" align="center" sortable prop="updateTimeHsja">
        <template #default="scope">
          <el-text type="primary" size="small">{{ scope.row.updateTimeHsja }}</el-text>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
                     v-hasPermi="['enterprise:base:edit']">修改
          </el-button>
          <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
                     v-hasPermi="['enterprise:base:remove']">删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
        v-show="total>0"
        :total="total"
        :page-sizes="[10, 50, 80, 100,200]"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        @pagination="getList"
    />
    <!-- 添加或修改沪深京A对话框 -->
    <el-dialog :title="title" v-model="open" width="500px" append-to-body>
      <el-form ref="baseRef" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="代码" prop="stockCode">
          <el-input v-model="form.stockCode" placeholder="请输入代码"/>
        </el-form-item>
        <el-form-item label="名字" prop="stockName">
          <el-input v-model="form.stockName" placeholder="请输入名字"/>
        </el-form-item>
        <el-form-item label="最新价" prop="price">
          <el-input v-model="form.price" placeholder="请输入最新价"/>
        </el-form-item>
        <el-form-item label="涨幅" prop="raiseRange">
          <el-input v-model="form.raiseRange" placeholder="请输入涨幅"/>
        </el-form-item>
        <el-form-item label="成交额" prop="txAmount">
          <el-input v-model="form.txAmount" placeholder="请输入成交额"/>
        </el-form-item>
        <el-form-item label="成交量" prop="txCount">
          <el-input v-model="form.txCount" placeholder="请输入成交量"/>
        </el-form-item>
        <el-form-item label="换手率" prop="txRate">
          <el-input v-model="form.txRate" placeholder="请输入换手率"/>
        </el-form-item>
        <el-form-item label="市净率" prop="pb">
          <el-input v-model="form.pb" placeholder="请输入市净率"/>
        </el-form-item>
        <el-form-item label="市盈率" prop="pe">
          <el-input v-model="form.pe" placeholder="请输入市盈率"/>
        </el-form-item>
        <el-form-item label="量比" prop="countRate">
          <el-input v-model="form.countRate" placeholder="请输入量比"/>
        </el-form-item>
        <el-form-item label="核心题材" prop="tcName">
          <el-input v-model="form.tcName" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="入选原因" prop="selectedBoardReason">
          <el-input v-model="form.selectedBoardReason" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="公司简介" prop="companyUrl">
          <el-input v-model="form.companyUrl" placeholder="请输入公司简介"/>
        </el-form-item>
        <el-form-item label="沪深京A更新" prop="updateTimeHsja">
          <el-date-picker clearable
                          v-model="form.updateTimeHsja"
                          type="date"
                          value-format="YYYY-MM-DD"
                          placeholder="请选择沪深京A更新">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="题材更新" prop="updateTimeTc">
          <el-date-picker clearable
                          v-model="form.updateTimeTc"
                          type="date"
                          value-format="YYYY-MM-DD"
                          placeholder="请选择题材更新">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="股东数更新" prop="updateTimeHolderCount">
          <el-date-picker clearable
                          v-model="form.updateTimeHolderCount"
                          type="date"
                          value-format="YYYY-MM-DD"
                          placeholder="请选择股东数更新">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="公司名字" prop="companyName">
          <el-input v-model="form.companyName" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="主营业务" prop="mainBusiness">
          <el-input v-model="form.mainBusiness" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="股东人数" prop="holderTotalNum">
          <el-input v-model="form.holderTotalNum" placeholder="请输入股东人数"/>
        </el-form-item>
        <el-form-item label="股东变化率" prop="holderTotalNumRatio">
          <el-input v-model="form.holderTotalNumRatio" placeholder="请输入股东变化率"/>
        </el-form-item>
        <el-form-item label="人均流通股数" prop="aveFreeSharesNum">
          <el-input v-model="form.aveFreeSharesNum" placeholder="请输入人均流通股数"/>
        </el-form-item>
        <el-form-item label="人均流通股变化率" prop="aveFreeSharesRatio">
          <el-input v-model="form.aveFreeSharesRatio" placeholder="请输入人均流通股变化率"/>
        </el-form-item>
        <el-form-item label="筹码集中度" prop="holdFocus">
          <el-select v-model="form.holdFocus" placeholder="请选择筹码集中度">
            <el-option
                v-for="dict in com_hold_focus"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="股东股价" prop="avePrice">
          <el-input v-model="form.avePrice" placeholder="请输入股东股价"/>
        </el-form-item>
        <el-form-item label="人均金额" prop="aveHoldAmt">
          <el-input v-model="form.aveHoldAmt" placeholder="请输入人均金额"/>
        </el-form-item>
        <el-form-item label="十大股东持股合计(%)" prop="holdRatioTotal">
          <el-input v-model="form.holdRatioTotal" placeholder="请输入十大股东持股合计(%)"/>
        </el-form-item>
        <el-form-item label="十大流通股东持股合计(%) " prop="freeholdRatioTotal">
          <el-input v-model="form.freeholdRatioTotal" placeholder="请输入十大流通股东持股合计(%) "/>
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
    <!--    入选原因详情-->
    <el-dialog
        draggable
        :title="detailTitleReason"
        append-to-body
        modal
        v-model="dialogVisibleReasonOpen"
        width="60%"
        center
    >
      <span>{{ selectedBoardReason }}</span>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="showDetailReason('','',false)">取 消</el-button>
          <el-button type="primary" @click="showDetailReason('','',false)">确 定</el-button>
        </div>
      </template>
    </el-dialog>
    <!--    题材详情-->
    <el-dialog draggable :title="detailTitleTc" v-model="dialogVisibleTcOpen" width="1000px" append-to-body>
      <el-table :data="dialogVisibleTcData" border stripe style="width: 100%" max-height="550">
        <el-table-column prop="BOARD_NAME" label="题材名字" width="150px"/>
        <el-table-column prop="SELECTED_BOARD_REASON" label="入选理由"/>
      </el-table>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="showDetailTc('','',false)">取 消</el-button>
          <el-button type="primary" @click="showDetailTc('','',false)">确 定</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup name="Base">
import {Ellipsis} from 'vue-amazing-ui'
import tool from "@/utils/format_number.js"
import 'vue-amazing-ui/css'
import {listBase, getBase, delBase, addBase, updateBase} from "@/api/enterprise/base";
import {handlePeopleCount, handleYK} from "@/utils/text.js";

const {proxy} = getCurrentInstance();
const {com_hold_focus} = proxy.useDict('com_hold_focus');

const baseList = ref([]);
const open = ref(false);

const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const dialogVisibleReasonOpen = ref(false);
const detailTitleReason = ref("");
const selectedBoardReason = ref("");
const dialogVisibleTcOpen = ref(false);
const dialogVisibleTcData = ref([])
const detailTitleTc = ref("");

const data = reactive({
  form: {},
  queryParams: {
    pageNum: 1,
    pageSize: 10, //页数默认值修改
    stockCode: null,
    stockName: null,
    price: 3,
    price1: 20,
    raiseRange: null,
    txAmount: null,
    txCount: null,
    txRate: null,
    txRate1: null,
    pb: null,
    countRate: null,
    tcName: null,
    tcDetail: null,
    updateTimeHsja: null,
    holderTotalNumRatio: null,
    selectedBoardReason: null,
    companyName: null,
    holderTotalNum: 4000,
    holderTotalNum1: 60000,
    holdFocus: null,
  },
  rules: {
    stockCode: [
      {required: true, message: "代码不能为空", trigger: "blur"}
    ],
    companyUrl: [
      {required: true, message: "公司简介不能为空", trigger: "blur"}
    ],
  }
});

const {queryParams, form, rules} = toRefs(data);

/** 查看原因详情 */
function showDetailReason(title, detail, show) {
  dialogVisibleReasonOpen.value = show;
  detailTitleReason.value = title;
  selectedBoardReason.value = detail.replace(/(#)/g, '\n')
}

/** 查看题材详情 */
function showDetailTc(title, detail, show) {
  dialogVisibleTcOpen.value = show;
  let stc = JSON.parse(detail)
  detailTitleTc.value = title + ' 题材数 : ' + stc.length;
  dialogVisibleTcData.value = stc
  // console.log('dialogVisibleTcData', dialogVisibleTcData.value)
}


/** 查询沪深京A列表 */
function getList() {
  loading.value = true;
  listBase(queryParams.value).then(response => {
    baseList.value = response.rows;
    total.value = response.total;
    loading.value = false;
  });
}

// 取消按钮
function cancel() {
  open.value = false;
  reset();
}

// 表单重置
function reset() {
  form.value = {
    id: null,
    stockCode: null,
    stockName: null,
    price: null,
    price1: null,
    raiseRange: null,
    txAmount: null,
    txCount: null,
    txRate: null,
    txRate1: null,
    pb: null,
    pe: null,
    countRate: null,
    tcName: null,
    selectedBoardReason: null,
    tcDetail: null,
    tcCount: null,
    companyType: null,
    companyUrl: null,
    updateTimeHsja: null,
    updateTimeTc: null,
    updateTimeHolderCount: null,
    companyName: null,
    mainBusiness: null,
    holderTotalNum: null,
    holderTotalNum1: null,
    holderTotalNumRatio: null,
    aveFreeSharesNum: null,
    aveFreeSharesRatio: null,
    holdFocus: null,
    avePrice: null,
    aveHoldAmt: null,
    holdRatioTotal: null,
    freeholdRatioTotal: null
  };
  proxy.resetForm("baseRef");
}

/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1;
  getList();
}

/** 重置按钮操作 */
function resetQuery() {
  proxy.resetForm("queryRef");
  handleQuery();
}

// 多选框选中数据
function handleSelectionChange(selection) {
  ids.value = selection.map(item => item.id);
  single.value = selection.length != 1;
  multiple.value = !selection.length;
}

/** 新增按钮操作 */
function handleAdd() {
  reset();
  open.value = true;
  title.value = "添加沪深京A";
}

/** 修改按钮操作 */
function handleUpdate(row) {
  reset();
  const _id = row.id || ids.value
  getBase(_id).then(response => {
    form.value = response.data;
    open.value = true;
    title.value = "修改沪深京A";
  });
}


/** 提交按钮 */
function submitForm() {
  proxy.$refs["baseRef"].validate(valid => {
    if (valid) {
      if (form.value.id != null) {
        updateBase(form.value).then(response => {
          proxy.$modal.msgSuccess("修改成功");
          open.value = false;
          getList();
        });
      } else {
        addBase(form.value).then(response => {
          proxy.$modal.msgSuccess("新增成功");
          open.value = false;
          getList();
        });
      }
    }
  });
}

/** 删除按钮操作 */
function handleDelete(row) {
  const _ids = row.id || ids.value;
  proxy.$modal.confirm('是否确认删除沪深京A编号为"' + _ids + '"的数据项？').then(function () {
    return delBase(_ids);
  }).then(() => {
    getList();
    proxy.$modal.msgSuccess("删除成功");
  }).catch(() => {
  });
}

/** 导出按钮操作 */
function handleExport() {
  proxy.download('enterprise/base/export', {
    ...queryParams.value
  }, `base_${new Date().getTime()}.xlsx`)
}

getList();
</script>
<style>
span {
  word-break: normal;
  width: auto;
  display: block;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: hidden;
}
</style>
<style>
.base-table .el-tag__content {
  font-size: 9px; /* 设置表格文字大小 */
}

.base-table .el-table__body th {
  font-size: 6px; /* 设置表头文字大小 */
}

.base-table .el-table__body td {
  font-size: 10px; /* 设置表格单元格文字大小 */
}

.el-text {
  font-size: 10px; /* 设置表格单元格文字大小 */
}
</style>
